/*
包含n个接口请求函数的模块
函数的返回值: promise对象
 */
import ajax from './ajax'

const BASE_URL = '/api';

//获取登录的数据
export const getLogin = () => ajax(BASE_URL + '/login', {});

//用户名密码登陆
export const reqLogin = ({account, password, captcha, uuid}) => ajax(BASE_URL + '/login', {account, password, captcha, uuid}, 'POST');

//查询校验验证码
export const verifyCaptcha = ({jym}) => ajax(BASE_URL + '/public/verify/captcha', {jym}, 'POST');

//查询软考成绩
export const getScore = ({stage, zjhm, xm, jym, select_type}) => ajax(BASE_URL + '/public/score/search', {stage, zjhm, xm, jym, select_type}, 'POST');

//获取科目的类型
export const getSubjectType = (params) => ajax(BASE_URL + '/public/subject/type', params, 'POST');

//获取科目的类型
export const getSubject = (params) => ajax(BASE_URL + '/public/subject', params, 'POST');

//获取科目的试卷（真题、章节、模拟、每天一练）
export const getSubjectPaper = (params) => ajax(BASE_URL + '/public/subject/paper', params, 'POST');

//获取试卷
export const getPaper = (params) => ajax(BASE_URL + '/public/paper', params, 'POST');

//获取试卷的题目
export const getPaperQuestion = (params) => ajax(BASE_URL + '/public/paper/question', params, 'POST');

//获取所有报考指南
export const getGuide = (params) => ajax(BASE_URL + '/public/guide', params, 'POST');

//获取报考指南详情
export const getGuideDO = (params) => ajax(BASE_URL + '/public/getGuideDO', params, 'POST');

/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

//选择对应的科目
export const reqSubjectSelect = (params) => ajax(BASE_URL + '/auth/subject/select', params, 'POST');

//用户选择的科目
export const reqUserSubject = (params) => ajax(BASE_URL + '/auth/user/subject', params, 'POST');
